package com.spider.common.bean.enums;

import lombok.Data;

/**
 * @author marver
 * @Description
 * @date 2019/4/8 16:00
 */
public enum TenderUrlEnum {
    OKCIS(1, "招标采购导航网", "http://www.okcis.cn/php/new_site/search/list_ajax_search.php"),
    CHINABIDDING(2, "中国采购招标网", "http://www.chinabidding.cc/search/index.html");

    private int id;
    private String text;
    private String url;

    TenderUrlEnum(int id, String text, String url) {
        this.id = id;
        this.text = text;
        this.url = url;
    }

    public int getId() {
        return id;
    }

    public String getUrl() {
        return url;
    }

    //根据id获取枚举
    public static TenderUrlEnum getEnumById(int id){
        for(TenderUrlEnum temp : TenderUrlEnum.values()){
            if(temp.getId() == id){
                return temp;
            }
        }
        return null;
    }
}
